package controller

import (
	"context"
	"xr-game-server/core/httpserver"
	"xr-game-server/dto/serverdto"
	"xr-game-server/entity"
	"xr-game-server/module/server"
)

const (
	Server = "server"
)

type CMSCustomerServer struct {
}

func initCustomerServer() {
	httpserver.RegCMSCustomizeRes(Server, &CMSCustomerServer{})
}

func (this *CMSCustomerServer) Page(ctx context.Context, req *serverdto.CMSServerReq) (res *httpserver.CMSQueryResp, err error) {
	return server.Page(ctx, req)
}

func (this *CMSCustomerServer) Save(ctx context.Context, req *serverdto.SaveServerReq) (res bool, err error) {
	return server.SaveServer(ctx, req)
}

func (this *CMSCustomerServer) SaveZone(ctx context.Context, req *serverdto.SaveZoneReq) (res bool, err error) {
	return server.SaveZone(ctx, req)
}

func (this *CMSCustomerServer) PageZone(ctx context.Context, req *serverdto.GetZoneReq) (res *httpserver.CMSQueryResp, err error) {
	return server.PageZone(ctx, req)
}

func (this *CMSCustomerServer) GetComboData(ctx context.Context, req *serverdto.GetZoneComboReq) (data []*entity.Zone, err error) {
	return server.GetComboData()
}

func (this *CMSCustomerServer) OpenServer(ctx context.Context, req *serverdto.OpenServerReq) (bool, error) {
	return server.OpenServer(ctx, req)
}

func (this *CMSCustomerServer) CloseServer(ctx context.Context, req *serverdto.CloseServerReq) (bool, error) {
	return server.CloseServer(ctx, req)
}
func (c *CMSCustomerServer) MergeServer(ctx context.Context, req *serverdto.MergeServerReq) (bool, error) {
	return server.MergeServer(ctx, req)
}
